using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

public class PlayerAnimationTrigger : MonoBehaviour
{
   public Player player => GetComponentInParent<Player>();

    
    private void AnimationTrigger()
    {
        player.AnimationTrigger();
    }


    private void AttackTrigger()
    {
        AudioManager.Instance.PlaySound((int)E_SoundType.PlayerPrimaryAttack);
        Collider2D[] colliders = Physics2D.OverlapCircleAll(player.attackCheck.position,player.attackRadius);

        foreach (var collider in colliders)
        {
            EnemyData enemy = collider.GetComponent<EnemyData>();
            if ( enemy != null)
            {
                player.data.DoDamage(enemy);
                //AudioManager.Instance.PlaySound((int)E_SoundType.WomanStruggle, collider.AddComponent<AudioSource>());
            }
            
        }
    }
    

    void ThrowSword()
    {
        SkillManager.Instance.sword.CreateSword();  
    }
}
